package com.cow.horse.service;

import com.cow.horse.entity.HealthRecord;
import com.cow.horse.repository.HealthRecordRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HealthService {
    @Autowired
    private HealthRecordRepository healthRecordRepository;

    public HealthRecord findByUsername(String username) {
        return healthRecordRepository.findByName(username);
    }

    public HealthRecord updateHealthRecord(HealthRecord record) {
        return healthRecordRepository.save(record);
    }
}
